﻿using System;
using System.ComponentModel.DataAnnotations;

namespace K9Nano.Admin.Weixin.Dto
{
    public class WeixinMpBindModel: WeixinMpLoginModel
    {
        [Required(ErrorMessage = "手机号不能为空")]
        public string Phone { get; set; }

        [Required(ErrorMessage = "验证码不能为空")]
        public string Code { get; set; }

        [Required(ErrorMessage = "验证码消息ID不能为空")]
        public string MessageId { get; set; }

        [Required] 
        public string CaptchaId { get; set; } = Guid.NewGuid().ToString();

        public string Profile { get; set; }

        public WeixinMpBindModel()
        {
            
        }

        public WeixinMpBindModel(WeixinMpLoginModel login)
        {
            ClientId = login.ClientId;
            AppId = login.AppId;
            OpenId = login.OpenId;
            UnionId = login.UnionId;
            ReturnUrl = login.ReturnUrl;
            Sign = login.Sign;
        }
    }
}